package com.hornsun.repository;

import com.hornsun.domain.dbo.Prescription;
import com.hornsun.repository.mapper.PrescriptionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by 编译中... on 2018/2/5.
 */
@Repository
public class PrescriptionRepository {
    @Autowired
    private PrescriptionMapper prescriptionMapper;

    /**
     * 插入处方数据
     * @param prescription
     * @return
     */
    public int insertPrescription(Prescription prescription){
        return prescriptionMapper.insertSelective(prescription);
    }

    /**
     * 查询处方
     * @param guid
     * @return
     */
    public Prescription getPrescription(String guid){
        return prescriptionMapper.selectByPrimaryKey(guid);
    }
}
